Platform Explorer / Nuxeo Platform LTS 2017 9.10

Contribution org.nuxeo.ecm.platform.rendition.download.contrib--defaultRendition

This contribution is part of XML component org.nuxeo.ecm.platform.rendition.download.contrib inside nuxeo-platform-rendition-core-9.10.jar /OSGI-INF/rendition-download-contrib.xml

Extension Point

Extension point defaultRendition of component RenditionService.

Contributed Items

  • <defaultRendition>
          <script language="JavaScript">
            function run() {
              if (Reason == 'download') {
                if (Document.getType() == "File") {
                  return 'mainBlob';
                } else if (Document.getType() == 'Picture') {
                  return 'mainBlob';
                } else if (Document.getType() == 'Video') {
                  return 'mainBlob';
                } else if (Document.getType() == 'Audio') {
                  return 'mainBlob';
                } else if (Document.getType() == 'Note') {
                  return 'pdf';
                } else if (Document.getType() == 'Collection') {
                  return 'containerDefaultRendition';
                } else if (Document.getType() == 'Folder') {
                  return 'containerDefaultRendition';
                } else {
                  return 'xmlExport';
                }
              } else {
                return 'xmlExport';
              }
            }
          </script>
        </defaultRendition>

XML Source

<extension point="defaultRendition" target="org.nuxeo.ecm.platform.rendition.service.RenditionService">
    <defaultRendition>
      <script language="JavaScript">
        function run() {
          if (Reason == 'download') {
            if (Document.getType() == "File") {
              return 'mainBlob';
            } else if (Document.getType() == 'Picture') {
              return 'mainBlob';
            } else if (Document.getType() == 'Video') {
              return 'mainBlob';
            } else if (Document.getType() == 'Audio') {
              return 'mainBlob';
            } else if (Document.getType() == 'Note') {
              return 'pdf';
            } else if (Document.getType() == 'Collection') {
              return 'containerDefaultRendition';
            } else if (Document.getType() == 'Folder') {
              return 'containerDefaultRendition';
            } else {
              return 'xmlExport';
            }
          } else {
            return 'xmlExport';
          }
        }
      </script>
    </defaultRendition>
  </extension>